package com.bamboo.tool.template.export.view.actions;

import com.bamboo.tool.entity.QueryClassParameter;
import com.bamboo.tool.template.export.view.dialog.ExportDialogWrapper;
import com.bamboo.tool.template.yapi.view.dialog.UploadYapiDialogWrapper;
import com.bamboo.tool.util.I18nUtil;
import com.bamboo.tool.util.PsiUtils;
import com.bamboo.tool.view.component.tree.ApiTree;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import org.jetbrains.annotations.NotNull;

public class ExportAction extends DumbAwareAction {

    private ApiTree apiTree;

    public ExportAction(ApiTree apiTree) {
        super("导出", "导出为其他文件", AllIcons.ToolbarDecorator.Export);
        this.apiTree = apiTree;
    }
    @Override
    public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
        QueryClassParameter queryClassParam = PsiUtils.getQueryClassParameter(apiTree);
        new ExportDialogWrapper(queryClassParam, anActionEvent.getProject()).showAndGet();
    }
}
